<div class="da-list-wrap">
  <div class="da-content-banner">
    <d-breadcrumb>
      <d-breadcrumb-item><a routerLink="/">{{ 'system.breadcrumb.home' | translate }}</a></d-breadcrumb-item>
      <d-breadcrumb-item>{{ 'system.breadcrumb.ReviewFlow' | translate }}</d-breadcrumb-item>
    </d-breadcrumb>
  </div>
  <div class="da-content-wrapper">
    <div class="da-list-container">
      <div class="da-list-header">
        <d-row>
          <d-col [dSpan]="24">
            <div class="btn-group">
              <!-- <d-button bsstyle="primaryBtn" (btnClick)="Creat()">
                    <i class="icon icon-add me-2"></i>新增
                  </d-button>
                  <d-button bsStyle="danger" (btnClick)="CheckDelete()"><i class="icon icon-delete me-2"></i>删除</d-button> -->

            </div>
          </d-col>
        </d-row>
      </div>
      <div class="list-content">
        <d-data-table [dataSource]="ReviewFlowData" [lazy]="true" [scrollable]="true" [fixHeader]="true"
          [tableWidthConfig]="tableWidthConfig" [tableOverflowType]="'auto'" [scrollable]="true" [resizeable]="true"
          (checkAllChange)="getCheckedRows()" (rowCheckChange)="getCheckedRows()">
          <thead dTableHead [checkable]="true">
            <tr dTableRow>
              <th dHeadCell [fixedLeft]="'80px'">
                <span>操作</span>
              </th>
              <th dHeadCell *ngFor="let colOption of dataTableOptions.columns">{{ colOption.header }}</th>
            </tr>
          </thead>
          <tbody dTableBody>
            <ng-template let-rowItem="rowItem" let-rowIndex="rowIndex" let-nestedIndex="nestedIndex">
              <tr dTableRow>
                <td dTableCell [fixedLeft]="'0px'">
                  <d-checkbox [disabled]="false" [showAnimation]="true" [ngModelOptions]="{ standalone: true }"
                    [ngModel]="rowItem.$checked" [halfchecked]="rowItem.$halfChecked" dTooltip [showGlowStyle]="false"
                    (ngModelChange)="onRowCheckChange($event, rowIndex, nestedIndex, rowItem)"></d-checkbox>
                </td>
                <td dTableCell [rowItem]="rowItem">
                  <span (click)="update(rowItem)"><a class="devui-link">编辑</a></span>
                  <span class="ms-3" (click)="FlowNode(rowItem)"><a class="devui-link">设计</a></span>
                  <span class="ms-3"><a (click)="Enable(rowItem.approvalFlowConfigId)" class="devui-link"
                      [class.disabled]="rowItem.isEnable == true">启用</a></span>
                  <span class="ms-3"><a [class.disabled]="rowItem.isEnable == false" class="devui-link-danger"
                      (click)="Disable(rowItem.approvalFlowConfigId)">禁用</a></span>
                </td>
                <td dTableCell [rowItem]="rowItem" [field]="'showType'">
                  <span dTooltip [content]="rowItem?.approvalType">{{ rowItem?.approvalType }}</span>
                </td>
                <td dTableCell [rowItem]="rowItem" [field]="'enabled'">
                  <span dTooltip [content]="rowItem.description">{{ rowItem.description }}</span>
                </td>
                <td dTableCell [rowItem]="rowItem" [field]="'enabled'">
                  <span>
                    <d-tag [tag]="rowItem?.isEnable | status" [labelStyle]="rowItem?.isEnable"></d-tag>
                  </span>
                </td>
              </tr>
            </ng-template>
          </tbody>
        </d-data-table>
      </div>
      <div class="page-footer">
        <div>
          <p>已选 <span class="underline">{{checkedIds.length}}</span> 条
            <a class="clear" (click)="cleared()">清空</a>
          </p>
        </div>
        <d-pagination [size]="'sm'" [canViewTotal]="true" [canChangePageSize]="true" [canJumpPage]="true" [maxItems]="5"
          [total]="this.pager.total" [pageSizeOptions]="this.pageSizeOptions" [(pageSize)]="pager.pageSize"
          [(pageIndex)]="pager.pageIndex" (pageIndexChange)="pageIndexChange($event)"
          (pageSizeChange)="pageSizeChange($event)">
        </d-pagination>
      </div>
    </div>
  </div>
</div>
<d-toast [value]="msgs" [life]="2000" [styleClass]="'custom-class'" [style]="{ left: '50%',top:'10px' }"></d-toast>
